<!DOCTYPE html>
<html lang="en">
<head>
    <!--
    @Author 硕鼠
    @Date 2020/4/7 9:56
    @Version 1.0
    @Description 不定参数arguments的用法
  -->
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        // arguments是一个参数数组
        function sum() { //不定参数的求和
            var result = 0;
            for (var i = 0;i < arguments.length;i++){
                result += arguments[i];
            }
            return  result;
        }
        alert(sum(1.2,2,3));
    </script>
</head>
<body>

</body>
</html>